#include "bk_private/bk_init.h"
#include <components/system.h>
#include <os/os.h>
#include <components/shell_task.h>
#include <stdio.h>
#include "doorbell_comm.h"
#include "media_service.h"
#include "bkwl_common.h"

extern void user_app_main(void);
extern void rtos_set_user_app_entry(beken_thread_function_t entry);

void user_app_main(void)
{
	// #if CONFIG_INTEGRATION_DOORBELL
	// 	printf("twh boke user_app_main entry\n\n");
	// 	doorbell_core_init();
	// 	printf("twh user_app_main exit\n\n");

	// #else
	// 	bk_doorbell_main();
	// #endif

	printf("\n\n\n\n\n\n\n\n\n\n");
	printf("================================\n\n");
	printf("================================\n\n");
	printf("twh boke user_app_main entry\n\n");
	printf("================================\n\n");
	printf("================================\n\n");
#if BK_RUN_MODE_NOW == BK_RUN_MODE_CALL
	printf("twh boke sibo 1\n\n");
	doorbell_core_init();
	printf("twh boke sibo  2\n\n");
#else
	printf("twh boke normal 1\n\n");
	bkwl_common_main();
	printf("twh boke normal 2\n\n");

#endif
	printf("twh user_app_main exit\n\n");
}

int main(void)
{
#if (CONFIG_SYS_CPU0)
	printf("twh boke main entry\n\n");
	rtos_set_user_app_entry((beken_thread_function_t)user_app_main);
	// bk_set_printf_sync(true);
	// shell_set_log_level(BK_LOG_WARN);
#endif
	bk_init();
	media_service_init();
	printf("twh main exit\n\n");

	return 0;
}